const domain = require('domain')
const http = require('http')
const fs = require('fs')
const d = domain.create()
d.name = 'd1'
d.on('error', function (err) {
  console.error('捕捉到错误', d.name, err);
})
d.run(function () {
  process.nextTick(function () {
    setTimeout(() => {
      fs.open('no exit file', 'r', function (err, fd) {
        if (err) {
          throw err;
        } else {

        }
      })
    }, 1000)
  })
})